package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.time.LocalDate;

/**
 * 商品实体类
 */
@TableName("t_product")
public class ProductBean {
    /**商品编号**/
    @TableId(value = "pk_productId",type = IdType.AUTO)
    private Integer id;
    /**商品名**/
    @TableField("p_name")
    private String name;
    /**单价号**/
    @TableField("p_price")
    private Integer price;
    /**产地**/
    @TableField("p_address")
    private String address;
    /**生产日期**/
    @TableField("p_createDate")
    private LocalDate createDate;
    /**图片**/
    @TableField("p_img")
    private String img;
    /**销量**/
    @TableField(exist = false)
    private Integer saleNum;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getPrice() {
        return price;
    }

    public void setPrice(Integer price) {
        this.price = price;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public LocalDate getCreateDate() {
        return createDate;
    }

    public void setCreateDate(LocalDate createDate) {
        this.createDate = createDate;
    }

    public String getImg() {
        return img;
    }

    public void setImg(String img) {
        this.img = img;
    }

    public Integer getSaleNum() {
        return saleNum;
    }

    public void setSaleNum(Integer saleNum) {
        this.saleNum = saleNum;
    }

    @Override
    public String toString() {
        return "ProductBean{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", price=" + price +
                ", address='" + address + '\'' +
                ", createDate=" + createDate +
                ", img='" + img + '\'' +
                ", saleNum=" + saleNum +
                "}\n";
    }
}
